package com.umeng;

import android.app.Activity;

import com.umeng.socialize.PlatformConfig;
import com.umeng.socialize.ShareAction;
import com.umeng.socialize.bean.SHARE_MEDIA;
import com.umeng.socialize.media.UMImage;
import com.umeng.socialize.media.UMWeb;


/**
 * Created by root on 2015/12/29.
 */
public class UMUtils {
    public static void initUMShare() {
        PlatformConfig.setWeixin(IdAndKeys.WXAPPID, IdAndKeys.WXAPPSECRET);
    }

    public static void share(Activity mActivity, String title, String content, String shareUrl, String icon) {
        UMWeb web = new UMWeb(shareUrl);
        web.setTitle(title);//标题
        web.setThumb(new UMImage(mActivity, icon));  //缩略图
        web.setDescription(content);//描述
        new ShareAction(mActivity).withMedia(web)
                .setDisplayList(SHARE_MEDIA.WEIXIN, SHARE_MEDIA.WEIXIN_CIRCLE/*, SHARE_MEDIA.WEIXIN_FAVORITE*/)
                .setCallback(null).open();
    }


}
